import { BaseEntity } from './base.entity'
import { Column, JoinColumn, OneToOne, Entity, ManyToMany, ManyToOne } from 'typeorm'
import { UserEntity } from './user.entity'

@Entity('article')
export class ArticleEntity extends BaseEntity {
  @Column()
  title: string

  @Column()
  body: string

  @ManyToOne(
    type => UserEntity,
    user => user.articles,
  )
  user: UserEntity
}
